<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8" />
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<meta name="renderer" content="webkit">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"><!-- 初始化 -->
	<link rel="stylesheet" type="text/css" href="$!{basePath}/content/system/h5/css/common.css" /><!-- 阿里小图标 -->
	<link rel="stylesheet" type="text/css" href="$!{basePath}/content/system/h5/css/font.css" /><!-- 当前页面css -->
	<link rel="stylesheet" type="text/css" href="$!{basePath}/content/system/h5/css/index.css" />
	<link rel="stylesheet" href="//g.alicdn.com/msui/sm/0.6.2/css/sm.min.css">
	<link rel="stylesheet" href="//g.alicdn.com/msui/sm/0.6.2/css/sm-extend.min.css">
	<script src="$!{basePath}/app/js/vue.min.js"></script>
	<script src="$!{basePath}/app/js/axios.min.js"></script>
	<script type="text/javascript" src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script><!--微信转发包-->
	<script type='text/javascript' src='//g.alicdn.com/sj/lib/zepto/zepto.min.js' charset='utf-8'></script>
	<script src='//cdn.bootcss.com/jquery/3.1.1/jquery.min.js'></script>
	<script type='text/javascript' src='//g.alicdn.com/msui/sm/0.6.2/js/sm.min.js' charset='utf-8'></script>
	<script type='text/javascript' src='//g.alicdn.com/msui/sm/0.6.2/js/sm-extend.min.js' charset='utf-8'></script>
	<title></title>
	<style type="text/css">
		.cont{
			margin-top: 1.875rem;
			width: 100%;
			height: 100%;
		}
		.panel{
			width: 8rem;
		}
		body.with-panel-left-reveal .panel-overlay{
			margin-left: 8rem !important;
		}
		body.with-panel-left-reveal .page {
			-webkit-transform: translate3d(12rem,0,0);
			transform: translate3d(8rem,0,0);
		}
	</style>
</head>
<body>
<div id="con">
	<div class="page">
		<header class="bar bar-nav">
			<button class="button pull-left">
				<a href="#" class="button-fill open-panel" data-panel='#panel-left-demo'>
					<span class="iconfont icon-liebiao"></span>
				</a>
			</button>
			<button class="button pull-right">
				<span class="iconfont icon-wode wode" @click="url='/app/home/toPerson.do'"></span>
			</button>
			<h1 class="title"><span @click="url='/app/home/toMain.do'">工作台</span></h1>
		</header>
		<div class="cont">
			<iframe  name = "child" id = "child" v-bind:src="url" width="100%" height="100%" frameborder="0" scrolling="no"></iframe>
		</div>
	</div>
	<div class="panel-overlay"></div>
	<!-- Left Panel with Reveal effect -->
	<div class="panel panel-left panel-reveal theme-dark" id='panel-left-demo'>
		<ul class="list">
			<li v-for="(item,no) in list" v-cloak>
				<div class="txt" v-cloak>
					<div @click="isChildShow(no)">
						<span class="tit">
							{{item.authName}}
						</span>
						<span style="position: absolute;right: 10px;" v-if="item.childMenu.length>0">
							<span class="icon icon-down" v-if="isShow && index==no"></span>
							<span class="icon icon-right" v-else></span>
						</span>
					</div>
				</div>
				<div class="jycontel" v-for="(items,childno) in item.childMenu" v-show="isShow && index==no" @click="child(childno,items)">
					{{items.authName}}
					<span style="position: absolute;right: 10px;"  v-if="items.childMenu.length>0">
						<span class="icon icon-down" v-if="childisshow && childindex==childno"></span>
						<span class="icon icon-right" v-else></span>
					</span>
					<div class="jycontel" @click="route(itemss)" v-for="itemss in items.childMenu" v-show="childisshow && childindex==childno">
						{{itemss.authName}}
					</div>
				</div>
			</li>
		</ul>
	</div>
</div>
</body>
</html>
<script type="text/javascript">
	wx.config({
		debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来，若要查看传入的参数，可以在pc端打开，参数信息会通过log打出，仅在pc端时才会打印。
		appId: '$!{appId}', // 必填，公众号的唯一标识
		timestamp: "$!{wx.timestamp}", // 必填，生成签名的时间戳
		nonceStr: "$!{wx.nonceStr}", // 必填，生成签名的随机串
		signature: "$!{wx.signature}",// 必填，签名，见附录1
		jsApiList: ['onMenuShareTimeline','onMenuShareAppMessage','onMenuShareQQ'] // 必填，需要使用的JS接口列表，所有JS接口列表见附录2
	});
	wx.ready(function(){
		var shareData = {
			title: '大医国脉', // 分享标题
			desc: '大医国脉登录页', // 分享描述
			link: "http://www.gysc1808.com/app/login/index.do", // 分享链接
			imgUrl: 'http://www.gysc1808.com/profile/system/icon.png', // 分享图标
		};
		wx.onMenuShareTimeline(shareData);
		wx.onMenuShareAppMessage(shareData);
		wx.onMenuShareQQ(shareData);
		// config信息验证后会执行ready方法，所有接口调用都必须在config接口获得结果之后，config是一个客户端的异步操作，所以如果需要在页面加载时就调用相关接口，
		// 则须把相关接口放在ready函数中调用来确保正确执行。对于用户触发时才调用的接口，则可以直接调用，不需要放在ready函数中。
	});
	function href() {
		window.location.href = './hb.html'
	}
	function logout() {
		window.location.href = "/system/logout.do"
	}
	function toHref(toUrl) {
		window.location.href = toUrl;
	}
	function me() {
		window.location.href = "./gerenzhongxin.html"
	}

	var app = new Vue({
		el: "#con",
		data: {
			index: -1,
			isShow: false,
			childisshow:false,
			childindex:-1,
			list: [],
			url:"/app/home/toMain"
		},
		mounted() {
			this.getdata()
		},
		methods: {
			route(item){
				this.url= item.authContr
			},
			getdata(){
				axios({
					url: '/app/login/getMenu',
					method: 'get',
					header: 'application/json, text/plain, */*'
				}).then(res => {
					this.list=res.data.obj.menu
				});
			},
			isChildShow(index) {
				this.index = index
				this.isShow = !this.isShow
			},
			child(no,item){
				console.log(item)
				if(item.childMenu.length==0){
					this.route(item)
				}else{
					this.childindex=no;
					this.childisshow=!this.childisshow
				}
			}
		}
	})
</script>
